/**
 * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package coba.service.impl;

import java.util.List;

import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.exception.SystemException;

import coba.model.ItinerarioRecorrido;
import coba.model.LicenciaGuia;
import coba.model.Recorrido;
import coba.service.RecorridoLocalServiceUtil;
import coba.service.base.ItinerarioRecorridoLocalServiceBaseImpl;
import coba.service.persistence.ItinerarioRecorridoPK;

/**
 * The implementation of the R local service.
 *
 * <p>
 * All custom service methods should be put in this class. Whenever methods are added, rerun ServiceBuilder to copy their definitions into the {@link coba.service.ItinerarioRecorridoLocalService} interface.
 *
 * <p>
 * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
 * </p>
 *
 * @author rodri042
 * @see coba.service.base.ItinerarioRecorridoLocalServiceBaseImpl
 * @see coba.service.ItinerarioRecorridoLocalServiceUtil
 */
public class ItinerarioRecorridoLocalServiceImpl
		extends ItinerarioRecorridoLocalServiceBaseImpl {

	public ItinerarioRecorrido add(long itinerarioId, long recorridoId, long hora)
			throws SystemException {

		ItinerarioRecorrido itinerarioRecorrido = itinerarioRecorridoPersistence.
				create(counterLocalService.increment(ItinerarioRecorrido.class.getName()));

		itinerarioRecorrido.setItinerarioId(itinerarioId);
		itinerarioRecorrido.setRecorridoId(recorridoId);
		itinerarioRecorrido.setHora(hora);

		return super.addItinerarioRecorrido(itinerarioRecorrido);

	}
	
	public List<ItinerarioRecorrido> getByItinerarioId(long itinerarioId) throws SystemException {  
		return this.itinerarioRecorridoPersistence.findByItinerarioId(itinerarioId);
	}

	public List<ItinerarioRecorrido> findByRecorridoId(long recorridoId) throws SystemException {
		return this.itinerarioRecorridoPersistence.findByRecorridoId(recorridoId);
	}

	public void removeByItinerarioId(long itinerarioId) throws SystemException {  
		this.itinerarioRecorridoPersistence.removeByItinerarioId(itinerarioId);
	}

}
